import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Jiang Jinxi
 * Date: 2024-03-18
 * Time: 19:31
 */
public class Test4 {
    public static void main(String[] args) {
        System.out.print("输入两个数:");
        Scanner s = new Scanner(System.in);
        int a = s.nextInt();
        int b = s.nextInt();
        int c = a % b;
        while(c != 0){
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println("最大公约数:" + b);
    }
}
